package com.jt.service;

import com.jt.dao.CarMapper;
import com.jt.pojo.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper mapper;

    @Override
    public List<Car> getAll() {
        return mapper.selectList(null);
    }

    @Override
    public void deleteCar(Integer id) {
        mapper.deleteById(id);
    }

    @Override
    public void savecar(Car car) {
        mapper.insert(car);
    }

    @Override
    public void updateCar(Car car) {
        mapper.updateById(car);
    }
}
